package com.jf.filter;

import javax.servlet.*;
import java.io.IOException;

/**
 * Created with IntelliJ IDEA
 * Description:
 * User:22954
 * Date:2024-09-04
 * Time:1:20
 */
public class ChainFilter3 implements Filter {
    @Override
    public void init(FilterConfig filterConfig) throws ServletException {
        System.out.println("ChainFilter3 init");
    }

    @Override
    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
        System.out.println("ChainFilter3 thread1 name: " + Thread.currentThread().getName());
        System.out.println("ChainFilter3 thread1 id: " + Thread.currentThread().getId());
        System.out.println("ChainFilter3 doFilter");
        filterChain.doFilter(servletRequest, servletResponse);
        System.out.println("ChainFilter3 doFilter");
    }

    @Override
    public void destroy() {
        System.out.println("ChainFilter3 destroy");
    }
}
